<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px ;
            padding: 0px ;
        }
        .wrap {
            width: 500px;
            height: 500px;
            border-radius: 50%;
            margin: 0 auto;
            border: 1px solid red;
            position: relative;
        }
        .box {
            width: 400px;
            height: 300px;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
            background-color: lemonchiffon;
        }
        #res {
            width: 200px;
            text-align: center;
            line-height: 100px;
            height: 100px;
            position: absolute;
            background-color: #fff;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
        }
        #btn {
            width: 50px;
            height: 50px;
            position: absolute;
            left: 175px;
            top: 200px;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class = "box" >
            <p id="res"></p>
            <button id="btn">开始</button>
        </div>
    </div>
    <script>
        function getRandom( min , max ) {
            var res = parseInt( Math.random() * ( max - min ) + min ) ; 
            return res ; 
        }
        var flag = true ;
        var arr = ["周正","王国强","童为尚","彭沁鑫","查天任","陈智","陈锋","胡志谦","9","10","11","12","13","14","15","16","17","18","19","20"];
        var resEle = document.getElementById("res") ; 
        document.getElementById("btn").onclick = function () {
            if( flag ){
                var start = setInterval(function(){
                    var res = arr[getRandom(0,arr.length)] ; 
                    document.getElementById("res").innerHTML = res
                },200)
                
            }
            if ( !flag ){
                document.getElementById("btn").innerText = "停止" ;
                clearInterval(start);
            }
            flag = !flag ; 
        }
    </script>
</body>
</html>